/*
    created: 2023/4/9
    filename: Bridge.cpp
    author: 李东霖
    purpose: Bridge模式的演示代码
*/

#include"Bridge.h"
#include<iostream>

//实现Implementor的接口
void ConcreteImplementorA::OperationImpl() 
{
std::cout << "Implementation by ConcreateImplementorA\n";
}

//实现Implementor的接口
void ConcreteImplementorB::OperationImpl() 
{
std::cout << "Implementation by ConcreateImplementorB\n";    
}

//实现我们需要完成实现的抽象类
Abstruction::Abstruction(Implementor* pImplementor):m_pImplementor(pImplementor)
{

}
Abstruction::~Abstruction()
{
    delete m_pImplementor;
    m_pImplementor = nullptr;
}

//实现Abstraction抽象类留下的接口
void Abstruction::Operation() 
{ 
 m_pImplementor->OperationImpl(); 
}